package com.tianji.aigc.controller;


import com.tianji.aigc.service.IChatSessionService;
import com.tianji.aigc.vo.SessionVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 对话session 前端控制器
 * </p>
 *
 * @author z
 * @since 2025-09-02
 */
@RestController
@RequestMapping("/session")
public class ChatSessionController {
    @Autowired
    private IChatSessionService chatSessionService;

    /**
     * 新建会话
     * @return
     */
    @PostMapping
    public SessionVO createChat(@RequestParam(value = "n",defaultValue = "3")Integer num){
        return chatSessionService.createChat(num);
    }

    /**
     * 更换热门内容
     * @param num
     * @return
     */
    @GetMapping("/hot")
    public List<SessionVO.Example> changeChat(@RequestParam(value = "n",defaultValue = "3")Integer num){
        return chatSessionService.changeChat(num);
    }
}
